package com.supermarket.serivce;

import com.supermarket.dao.SupplierDao;
import com.supermarket.entity.SupplierEntity;
import java.util.ArrayList;

public class SupplierSerivce {
    private SupplierDao supplierDao = new SupplierDao();

    // 获取供应商列表
    public ArrayList<SupplierEntity> allSuppliers() {
        return supplierDao.allSuppliers();
    }

    // 通过ID搜索供应商
    public SupplierEntity getSupplierById(Long supplierId) {
        return supplierDao.getSupplierById(supplierId);
    }

    // 添加供应商
    public int insertSupplier(SupplierEntity supplier) {
        return supplierDao.insertSupplier(supplier);
    }

    // 修改供应商信息
    public int updateSupplier(SupplierEntity supplier) {
        return supplierDao.updateSupplier(supplier);
    }

    // 删除供应商
    public int deleteSupplier(SupplierEntity supplier) { return supplierDao.deleteSupplier(supplier); }
}